package ar.edu.utn.frsf.cidisi.ginet.generation.pnml2wscdl.elementstemplate;

import org.eclipse.emf.common.util.EList;
import org.pnml.tools.epnk.pnmlcoremodel.Page;
import org.w3._2005._10.cdl.CdlFactory;
import org.w3._2005._10.cdl.TChoreography;
import org.w3._2005._10.cdl.TParallel;
import org.w3._2005._10.cdl.TSequence;

public class AndWSCDL extends WSCDLStructure{
	
	public AndWSCDL(Page page, TChoreography choreography){
		this.page = page;
		this.choreography = choreography;
	}
	
	public TParallel createWSCDLElement(){
		TParallel tParallel = CdlFactory.eINSTANCE.createTParallel();

		EList<Page> pages1 = this.getPages(page);
		
		for(int i = 0; i < pages1.size(); i++){
			TSequence sequence1 = CdlFactory.eINSTANCE.createTSequence();
			this.addTo(sequence1, this.createPackageWscdl(pages1.get(i), this.choreography));
			tParallel.getSequence().add(sequence1);
		}
		
		return tParallel;
		
	}

}
